import { ABaseDecision } from "GameLoop/DecisionMaking/BaseDecision";

 
 
export class LostRoomDecision < T extends TaskType="spawn"> extends ABaseDecision<T>
{
 
   
    public isExpired(event: NormalEvent, region: string): boolean 
    {
        return true;
    }
    public makeTask(event: NormalEvent, region: string): IDecisionCode<T>|false
    {
        // 
        
        // 1.清理实体
        global.entityDB.clear(event.room);
        // 2.清理memory
        Memory.rooms[event.room] = undefined as any;
        let index = Memory.myrooms.findIndex(e=>e==event.room);
        Memory.myrooms.splice(0,index);
        // 3.清理布局
        Memory.Data.Plans[event.room]=undefined;
        return false
    }
    
}